from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from models import Event

class EventAdmin(admin.ModelAdmin):
	fieldsets = (
    	(None, {'fields': ('site', 'user', 'name', 'slug',)}),
	    (_(u'Event details'), {'fields': ('start_datetime', 'location', 
			'description', 'url',)}),
	    (_(u'Tagging'), {'fields': ('tags',),}),
		(_(u'Date information'), {'fields': ('pub_date',), 
		    'classes': 'collapse'}),
            (_(u'Settings'), {'fields': ('publication_status',)}),
        )
	list_display = ('name', 'pub_date', 'site', 'user', 'location', 
		'start_datetime', 'publication_status',)
	list_filter = ('pub_date', 'site', 'user', 'start_datetime',
		'publication_status',)
	search_fields = ['title']
	date_hierarchy = ('pub_date')
	prepopulated_fields = {'slug': ('name',)}
	radio_fields = {'publication_status': True}
	
admin.site.register(Event, EventAdmin)